<!DOCTYPE html>
<html lang="zh-cn">
   <head>
      <meta charset="utf-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1">
      <title>{$CONF['shopTitle']['fieldValue']}后台管理中心</title>
      <link href="__PUBLIC__/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="__ROOT__/Apps/Admin/View/css/AdminLTE.css" rel="stylesheet" type="text/css" />
      <!--[if lt IE 9]>
      <script src="__PUBLIC__/js/html5shiv.min.js"></script>
      <script src="__PUBLIC__/js/respond.min.js"></script>
      <![endif]-->
      <script src="__PUBLIC__/js/jquery.min.js"></script>
      <script src="__PUBLIC__/plugins/bootstrap/js/bootstrap.min.js"></script>
      <script src="__PUBLIC__/js/common.js"></script>
      <script src="__PUBLIC__/plugins/plugins/plugins.js"></script>
       <style>
            .shop-total span{
                margin-right: 20px;
            }
       </style>
   </head>
   <script>
   function getAreaList(objId,parentId,t,id){
	   var params = {};
	   params.parentId = parentId;
	   $('#'+objId).empty();
	   if(t<1){
		   $('#areaId3').empty();
		   $('#areaId3').html('<option value="">请选择</option>');
	   }
	   var html = [];
	   $.post("{:U('Admin/Areas/queryByList')}",params,function(data,textStatus){
		    html.push('<option value="">请选择</option>');
			var json = WST.toJson(data);
			if(json.status=='1' && json.list.length>0){
				var opts = null;
				for(var i=0;i<json.list.length;i++){
					opts = json.list[i];
					html.push('<option value="'+opts.areaId+'" '+((id==opts.areaId)?'selected':'')+'>'+opts.areaName+'</option>');
				}
			}
			$('#'+objId).html(html.join(''));
	   });
   }
   $(function(){
       <PHP>if($areaId1!=0){</PHP>
	   getAreaList("areaId2",'{$areaId1}',0,'{$areaId2}');
	   <PHP>}</PHP>  
	   <PHP>if($areaId2 != 0){</PHP>
	   getAreaList("areaId3",'{$areaId2}',1,'{$areaId3}');
	   <PHP>}</PHP>
	   $('#orderStatus').val({$orderStatus});
   });
   function settlement(url){
	   Plugins.Modal({url:url,title:'结算订单',width:600});
   }
   </script>
   <body class='wst-page'>
      <form method="post" action='{:U("Admin/OrderSettlements/index")}'>
       <div class='wst-tbar'>
                             地区：<select name='areaId1' id='areaId1' onchange='javascript:getAreaList("areaId2",this.value,0)'>
             <option value=''>请选择</option>
             <volist name="areaList" id="vo">
             <option value='{$vo['areaId']}' <if condition="$areaId1 == $vo['areaId'] ">selected</if>>{$vo['areaName']}</option>
             </volist>
          </select>
          <select name='areaId2' id='areaId2' onchange='javascript:getAreaList("areaId3",this.value,1);'>
             <option value=''>请选择</option>
          </select>
          <select name='areaId3' id='areaId3'>
             <option value=''>请选择</option>
          </select>

           商家：<input name="shopName" value="{$shopName}">
           <button type="submit" class="btn btn-primary glyphicon glyphicon-search">查询</button>
       </div>
       <div class='wst-tbar'>

       </div>
       </form>
       <div class="wst-body"> 


               <table class="table table-hover table-striped table-bordered wst-list">
                   <tr>
                       <td width='40'>序号</td>
                       <td width='160'>消费时间</td>
                       <td width='150'>消费会员</td>
                       <td width='150'>消费金额</td>
                       <td width='150'>消费商家</td>
                       <td width='150'>结算金额</td>
                       <td>备注</td>
                       <td width="80">状态</td>
                       <td width='130'>操作</td>
                   </tr>
                   <tbody>

               <volist name="list" id="order" key="k">
                   <tr>
                       <td>{$k}</td>
                       <td>{$order['op_time']}</td>
                       <td>{$order['name']}</td>
                       <td>{$order['money']}</td>
                       <td>{$order['shopName']}</td>
                       <td></td>
                       <td></td>
                       <td>
                           <if condition='$order["isFinish"] eq 0'>未结算
                               <elseif condition='$order["isFinish"] eq 1'/>已结算
                           </if>
                       </td>
                       <td>
                           <if condition="$order['isFinish'] ==0 ">
                               <php>if(in_array('js_04',$WST_STAFF['grant'])){</php>
                               <a class="btn btn-primary glyphicon" href="javascript:settlement('{:U('Admin/OrderSettlements/toSettlement',array('id'=>$order['settlementId']))}')"">结算</a>
                               <php>}</php>
                           </if>
                       </td>
                   </tr>
               </volist>
                   </tbody>
               </table>


                <div  style="text-align:center">{$page}</div>


       </div>
   </body>
</html>